<template>
  <div class="admin">
    <el-table
    ref="singleTable"
    :data="getYonghuList"
    style="width: 100%">
    <el-table-column
      type="selection"
      align="center"
      width="55">
      </el-table-column>
      <!-- 用户编号/渠道 -->
      <el-table-column align="center" label="用户编号/渠道" >
        <template slot-scope="scope">
          <p>{{scope.row.id}}</p>
          <p>{{scope.row.sourceStr}}</p>
        </template>
      </el-table-column>
      <!-- 手机/昵称 -->
      <el-table-column align="center" label="手机/昵称" >
        <template slot-scope="scope">
          <p>{{scope.row.username}}</p>
          <p>-</p>
        </template>
      </el-table-column>
      <!-- 性别 -->
      <el-table-column align="center" prop="" label="性别" ></el-table-column>
      <!-- 所在地 -->
      <el-table-column align="center" prop="" label="所在地" >
        <template>
          <p>-</p>
          <p>-</p>
        </template>
      </el-table-column>
      <!-- 头像 -->
      <el-table-column align="center" prop="" label="头像" >-</el-table-column>
      <!-- 注册时间/IP -->
      <el-table-column align="center" label="注册时间/IP" >
        <template slot-scope="scope">
          <p>{{scope.row.dateAdd}}</p>
          <p>{{scope.row.ipAdd}}</p>
        </template>
      </el-table-column>
      <!-- 最后登录 -->
      <el-table-column align="center" prop="dateLogin" label="最后登录" >
        <template slot-scope="scope">
          <p>{{scope.row.dateLogin}}</p>
          <p>{{scope.row.ipLogin}}</p>
        </template>
      </el-table-column>
      <!-- 分销商 -->
      <el-table-column align="center" prop="" label="分销商" ></el-table-column>
      <!-- 状态 -->
      <el-table-column align="center" prop="" label="状态" ></el-table-column>
      <!-- 操作 -->
      <el-table-column align="center" label="操作" >
        <template slot-scope="scope">
          <el-button type="text">编辑</el-button>
          <el-button type="text" @click="delshanchu(scope.row)">删除</el-button>
        </template>
      </el-table-column>
    </el-table>
    <el-row>
      <el-col :span="18" :offset="6">
        <el-pagination
          @size-change="sizeChange"
          @current-change="currentChange"
          :current-page="getYonghuList.page"
          :page-sizes="[30, 50, 100]"
          :page-size="getYonghuList.pageSize"
          layout="total, sizes, prev, pager, next, jumper"
          :total="getTotal"
        >
        </el-pagination>
      </el-col>
    </el-row>
  </div>
</template>

<script>
import goodsMixin from "../../mixins"
  export default {
    name:'Admin',
    mixins:[goodsMixin],
    created(){
      this.setYonghuList()
    },
    methods:{
      delshanchu(v){
        this.$emit('delshan',v)
      },
      sizeChange(v){
        this.setYonghu({pageSize:v})
        this.setYonghuList()
      },
      currentChange(v){
        this.setYonghu({page:v})
        rhis.setYonghuList()
      }
    }
  }
</script>

<style lang="less" scoped>
  .tables{
    margin-top: 20px;
  }
  .goods-imgs{
    width: 100px;
  }

  .delBtn{
    margin-left: 0px;
  }
  .fenye{
    margin-top: 20px;
    margin-bottom: 50px;
  }
</style>